<template>
  <div>
    <div>{{pickerVisible|fromatDate('yyyy-MM-dd')}}</div>
    <div @click="openPicker">日期框测试</div>
    <div> 
      <mt-datetime-picker  :startDate='startDate' :endDate='endDate' @confirm="handleConfirm"
        ref="picker"   
         v-model="pickerVisible"
         type="date"
         year-format="{value} 年"
         month-format="{value} 月"
         date-format="{value} 日">  
      </mt-datetime-picker>
  </div>
</div>
</template>

<script>
import Vue from "vue";
import "mint-ui/lib/style.css";
import { DatetimePicker, Toast } from "mint-ui";
Vue.component(DatetimePicker.name, DatetimePicker);
export default {
  data() {
    return {
      msg: "abcdefg",
      pickerVisible: "",
      startDate:new Date("1950-01-01"),
      endDate:new Date()
    };
  },
  computed: {
    message() {}
  },
  methods: {
    openPicker() {
      this.$refs.picker.open();
    },
    handleConfirm() {
      console.log(this.pickerVisible);
    }
  }
};
</script>

<style <style lang="scss" scoped>
@import "~@/assets/css/util";
</style>
